﻿using FSM.IBll;
using FSM.Web.Models;
using FSM.Web.Models.Fileter;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace FSM.Web.Controllers
{
    public class BaseController : Controller
    {
        #region 属性
        /// <summary>
        /// 菜单/模块编号
        /// </summary>
        public string ModuleNo { get; set; }
        #endregion

        #region 构造函数
        public BaseController()
        {
        }
        #endregion

        /// <summary>
        /// 获得权限按钮
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        [ResultExceptionFilter]
        public JsonResult ListPowerAction()
        {
            ISysSettingBll _sysSettingBll = (ISysSettingBll)HttpContext.RequestServices.GetService(typeof(ISysSettingBll));
            string userNo = AuthencationHelper.GetLoginUserNo(User);
            var list = _sysSettingBll.ListPowerAction(userNo, ModuleNo);
            DataResultModel drm = new DataResultModel()
            {
                success = true,
                data = list
            };
            return drm.ToJson();
        }
    }
}
